Many of us have seen films containing remarkably realistic dinosaurs, aliens, animated toys and other fanciful creatures. Such animations are made possible by computer graphics. Using such techniques, a computer graphics artist can specify how each object should look and how it should change in appearance over time, and a computer then models the objects and displays them on a display such as your television or a computer screen. The computer takes care of performing the many tasks required to make sure that each part of the displayed image is colored and shaped just right based on the position and orientation of each object in a scene, the direction in which light seems to strike each object, the surface texture of each object, and other factors.
Because computer graphics generation is complex, computer-generated three-dimensional graphics just a few years ago were mostly limited to expensive specialized flight simulators, high-end graphics workstations and supercomputers. The public saw some of the images generated by these computer systems in movies and expensive television advertisements, but most of us couldn't actually interact with the computers doing the graphics generation. All this has changed with the availability of relatively inexpensive 3D graphics platforms such as, for example, the Nintendo 64® and various 3D graphics cards now available for personal computers. It is now possible to interact with exciting 3D animations and simulations on relatively inexpensive computer graphics systems in your home or office.
A problem graphics system designers confronted in the past was how to synchronize the graphics pipeline with external components such as the graphics command producer. A typical graphics rendering system consists of several asynchronous components (e.g., graphics command producer that generates graphics commands; the graphics processor consuming the commands and producing frame buffer outputs; and a display interface that displays the frame buffers). It is often desirable to synchronize these different stages of the rendering system to establish time-coherence between various operations. For example, it would be very useful for the graphics command producer to know under certain circumstances when the graphics processor has finished processing a given graphics command. The synchronization problem is complicated in that a typical graphics processor may take different amounts of time to process different graphics commands.
Various solutions to this problem were offered. For example, one technique that has been used in the past to provide synchronization between a graphics pipeline and a graphics command producer is to have the graphics pipeline send an interrupt to the command producer when all of the commands in a graphics display list have been processed. While this synchronization capability is very useful, it does not solve more intermediate synchronization requirements within a graphics display list (e.g., to enable the graphics command producer or other actor to perform some task other than sending new graphics commands while the graphics pipeline continues to work on the remainder of a display list).
It is known to insert variable content token identifiers into a graphics command stream to allow a graphics processor to pick between different items for processing. However, such token identifiers were not generally for synchronization purposes but were used instead to allow the graphics pipeline to identify data structures or other items it was to operate upon.
While significant work has been done in the past, further improvements are desirable.
The present invention solves the synchronization problem by providing techniques and arrangements that synchronize a graphics pipeline with an external actor such as, for example, a graphics command producer. In accordance with one aspect provided by this invention, a token including a variable data message is inserted into a graphics command stream sent to a graphics pipeline. At a predetermined point in the pipeline, the token is captured and a signal is generated indicating a token has arrived. An external device can look at the captured token to determine which of multiple possible tokens has been captured.
In one particular example, the graphics pipeline generates an interrupt when a token arrives at a predetermined point in the pipeline, and the other actor can poll a token register to determine the value of the captured token. The graphics command producer or other actor can use the token synchronization information to synchronize a task with the graphics pipeline, e.g., to maintain memory coherence in memory shared between the graphics pipeline and the graphics command producer. In accordance with another aspect of the invention, the graphics command producer can insert multiple tokens of different values in the same graphics command stream, and use a comparison to determine which token has arrived at the predetermined point in the graphics pipeline. Different tasks can be triggered based on which token has arrived at that point.
In accordance with one aspect provided by the invention, a method of synchronizing with a graphics pipeline comprises sending a variable content synchronization token down the graphics pipeline, and detecting when the token has reached a predetermined point in the pipeline. The token may comprise a variable content data message which, in one embodiment, the graphics pipeline does not modify. The detecting step may comprise comparing a value returned by a token register with a value of the sent token. The detecting step may include polling a token register in response to an interrupt.
In accordance with another aspect provided by this invention, a method of synchronizing with a graphics pipeline of the type including a command processor, a transformation unit, a lighting unit, a texture coordinate generator, a texture mapper, a rasterizer, a blender, a pixel engine and a frame buffer includes inserting a variable content data message into the graphics pipeline; capturing the variable content data message at a predetermined position within the pipeline; signaling when the variable content data message has reached the predetermined within the pipeline; and determining whether the captured variable content data message corresponds to the inserted variable content data message. A signaling step may comprise generating an interrupt when the variable content data message reaches the bottom of the pipeline. The capturing step may comprise storing the variable content data message in a register, and the determining step may comprise reading the contents of that register.
In accordance with still another aspect provided by this invention, a command processor receives a variable content data message and passes the variable content data message through a pipeline to a pixel engine. The pixel engine includes a register that captures the variable content data message and signals when the variable content data message has reached the pixel engine.
A still additional aspect provided by this invention provides a token comprising a variable content data message being inserted into a stream of graphics commands. A graphics system provides a response to an inquiry as to whether the portions of the graphics stream before the token have been processed to allow synchronization of graphics system events.